package customer.zspt.cn.customer.Services;

import android.app.Service;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;

import customer.zspt.cn.customer.Border.NetWorkStateBroder;

/**
 * Created by Administrator on 2018/8/18 0018.
 */

public class ListenerNetWorkChangeService extends Service {
    NetWorkStateBroder netWorkStateBroder;
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }
    @Override
    public void onStart(Intent intent, int startId) {
        super.onStart(intent, startId);
    }
    @Override
    public void onCreate() {
        super.onCreate();
        IntentFilter filter = new IntentFilter();
        filter.addAction("android.net.conn.CONNECTIVITY_CHANGE");
        netWorkStateBroder = new NetWorkStateBroder();
        registerReceiver(netWorkStateBroder,filter);
    }
    @Override
    public int onStartCommand(Intent intent,int flags, int startId) {
        return super.onStartCommand(intent, flags, startId);
    }
    @Override
    public void onDestroy() {
        super.onDestroy();
        unregisterReceiver(netWorkStateBroder);
    }
}
